// SpeedControl.c
// standard libs
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>


// additional libs 
#include "../../utils/LCD_functions.h"
#include "../../utils/util.h"


// Motor control circuit is connected to PortB  
//                              +---+---+---+---+---+
//            Port B            | 1 | x | X | X | V |    
//     Motor Control pins       +---+---+---+---+---+
//                              | 0 | x | x | x | G |  
//                              +---+---+---+---+---+
//  Pins marked with an X are not be used.
//	V stands for V+
//  G stands for ground
//  PB0 - Left motor PWM
//  PB1 - Right motor PWM

	

int main (void)
{ 
   Initialization();   //

	while(1)
	{	
		printLCD("Full Speed ahead");
		TimerWait(500);		// delay while letting go!
		SetLeftMotorPWM(10);//Set the left motor to top speed
		SetRightMotorPWM(10);//set the right motor to top speed
		TimerWait(1000);
        printLCD("Stop");
		SetLeftMotorPWM(0);//set the left motor to speed zero or stop
		SetRightMotorPWM(0);//set the right motor to speed zero or stop
		TimerWait(1500);
	}
}	
	
 
